package com.xxxx.crm.dao;

import com.xxxx.crm.base.BaseMapper;
import com.xxxx.crm.vo.Permission;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface PermissionMapper extends BaseMapper<Permission,Integer> {

    //通过角色ID查询权限记录
    void deletePermissionByRoleId(Integer roleId);

    //通过角色ID删除权限记录
    Integer countPermissionByRoleId(Integer roleId);

    //根据角色ID查询角色拥有的资源
    List<Integer> queryRoleHasModuleByRoleId(Integer roleId);

    //通过用户ID查询对应的资源列表(资源授权码)
    List<String> queryUserHasRoleHasPermissionByUserId(Integer userId);
}